package com.xmy.cultivate.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.cultivate.entity.Transcript;
import com.xmy.cultivate.entity.TranscriptSafetyDiffSet;
import com.xmy.cultivate.entity.TranscriptSafetyScoreSet;
import com.xmy.cultivate.entity.views.ScoreData;
import com.xmy.cultivate.entity.views.ScoreDataDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 成绩管理 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2023-04-14
 */
public interface TranscriptMapper extends BaseMapper<Transcript> {


    @Select({
            "<script>",
            "SELECT",
            "t.*,",
            "getStaffNameForId(teacher_id) as teacher_name,",

            "<if test= 'type == 6'>",
                "pid AS schoolPid,",
                "getSchoolName(t.school_id) as school_name,",
                "SUM(CASE WHEN score_end &lt; ${tsSet11.noPassScore} AND grade_section = 1 AND subjects_id &lt;&gt;3 ",
                    "AND ((is_statistics = 1 AND is_statistics_b = 1) OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ))",
                        "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                            "AND t.year_class_id IN (${yearClassId}) ",
                        "</when>",
                        "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                            "AND t.school_id IN (${schoolId}) ",
                        "</when>",
                        "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                            "AND t.subjects_id IN (${subjectsId}) ",
                        "</when>",
                        "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                            "AND `course_type_id` in(${courseTypeId}) ",
                        "</when>",
                    "THEN 1 WHEN (",
                    "(score_end &lt; ${tsSet12.noPassScore} and subjects_id &lt;&gt; 3) or (score_end &lt; ${tsSet32.noPassScore} and subjects_id =3)) AND grade_section = 2 ",
                    "AND ((is_statistics = 1 AND is_statistics_b = 1 ) OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ))",
                        "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                            "AND t.year_class_id IN (${yearClassId}) ",
                        "</when>",
                        "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                            "AND t.school_id IN (${schoolId}) ",
                        "</when>",
                        "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                            "AND t.subjects_id IN (${subjectsId}) ",
                        "</when>",
                        "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                            "AND `course_type_id` in(${courseTypeId}) ",
                        "</when>",
                "THEN 1 ELSE 0 END ) AS no_pass_count,",

                "SUM(CASE WHEN score_end &gt;= ${tsSet11.passScore} AND grade_section = 1 AND subjects_id &lt;&gt;3",
                    "AND (is_statistics = 1 AND is_statistics_b = 1 OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 )) ",
                        "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                            "AND t.year_class_id IN (${yearClassId}) ",
                        "</when>",
                        "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                            "AND t.school_id IN (${schoolId}) ",
                        "</when>",
                        "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                            "AND t.subjects_id IN (${subjectsId}) ",
                        "</when>",
                        "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                            "AND `course_type_id` in(${courseTypeId}) ",
                        "</when>",
                    "THEN 1 WHEN ((score_end &gt;= ${tsSet12.passScore} and subjects_id &lt;&gt; 3) or (score_end &gt;= ${tsSet32.passScore} and subjects_id =3)) AND grade_section = 2  ",
                    "AND ( is_statistics = 1 AND is_statistics_b = 1 OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ) OR (subjects_id = 3 and year_class_id = 8 AND t.quarter_num = 4 and is_statistics =1 ))",
                        "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                            "AND t.year_class_id IN (${yearClassId}) ",
                        "</when>",
                        "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                            "AND t.school_id IN (${schoolId}) ",
                        "</when>",
                        "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                            "AND t.subjects_id IN (${subjectsId}) ",
                        "</when>",
                        "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                            "AND `course_type_id` in(${courseTypeId}) ",
                        "</when>",
                "THEN 1 ELSE 0 END ) AS pass_count,",

                "SUM(CASE ",
                "<when test='tsSet11.includeThree == 0'>",
                    "WHEN score_end &gt;= ${tsSet11.passScore}",
                    "AND grade_section = 1 ",
                    "and subjects_id &lt;&gt;3",
                    "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                    "</when>",
                    "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                    "AND t.school_id IN (${schoolId}) ",
                    "</when>",
                    "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                    "</when>",
                    "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                    "</when>",
                    "AND (",
                    "( year_class_id = 3 AND t.quarter_num = 4 AND exam_num = 1  and subjects_id=1 AND is_statistics = 1 )) THEN",
                    "1 ",
                "</when>",
                " WHEN ((score_end >= ${tsSet32.passScore} AND subjects_id = 3)) AND grade_section = 2 AND ((year_class_id = 8 AND t.quarter_num = 4 AND exam_num = 1  AND is_statistics = 1 ))",
                    "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                        "AND t.year_class_id IN (${yearClassId}) ",
                    "</when>",
                    "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                        "AND t.school_id IN (${schoolId}) ",
                    "</when>",
                    "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                        "AND t.subjects_id IN (${subjectsId}) ",
                    "</when>",
                    "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                        "AND `course_type_id` in(${courseTypeId}) ",
                    "</when>",
                "THEN 1 ELSE 0 END ) AS not_calc_pass_count,",

                "SUM(CASE WHEN score_end &gt;= score_start_b and subjects_id &lt;&gt;3 AND grade_section = 1 AND is_statistics = 1 AND is_statistics_b = 1 AND score_end &lt; ${tsSet11.carryScore}  ",
                    "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                        "AND t.year_class_id IN (${yearClassId}) ",
                    "</when>",
                    "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                        "AND t.school_id IN (${schoolId}) ",
                    "</when>",
                    "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                        "AND t.subjects_id IN (${subjectsId}) ",
                    "</when>",
                    "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                        "AND `course_type_id` in(${courseTypeId}) ",
                    "</when>",
                "THEN 1 ",
                    "WHEN score_end &gt;= score_start_b AND grade_section = 2 AND is_statistics = 1 AND is_statistics_b = 1 ",
                    "AND ((score_end &lt; ${tsSet12.carryScore} and subjects_id  &lt;&gt;3) or (score_end &lt;${tsSet32.carryScore} and subjects_id =3 and year_class_id &lt;&gt; 8) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND t.quarter_num = 4 AND exam_num &lt;&gt; 1) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND t.quarter_num &lt;&gt; 4 )) ",
                    "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                        "AND t.year_class_id IN (${yearClassId}) ",
                    "</when>",
                    "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                        "AND t.school_id IN (${schoolId}) ",
                    "</when>",
                    "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                        "AND t.subjects_id IN (${subjectsId}) ",
                    "</when>",
                    "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                        "AND `course_type_id` in(${courseTypeId}) ",
                    "</when>",
                "THEN 1 ELSE 0 END ) AS carry_count,",

                "SUM(",
                "CASE",
                " WHEN ",
                "grade_section = 1 ",
                "and score_end &lt; score_start_b ",
                "and subjects_id &lt;&gt;3",
                " AND is_statistics = 1 ",
                " AND is_statistics_b = 1 ",
                "<when test='tsSet11.retrogressType != 1'>",
                "AND score_end &lt; ${tsSet11.retrogressScore}",
                "</when>",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                "AND t.school_id IN (${schoolId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
                "  THEN 1",
                "WHEN",
                "grade_section = 2 ",
                "and score_end &lt; score_start_b ",
                "  AND is_statistics = 1 ",
                "  AND is_statistics_b = 1 ",
                " AND ((subjects_id  &lt;&gt;3 ",
                "<when test='tsSet12.retrogressType != 1'>",
                "and score_end &lt; ${tsSet12.retrogressScore}",
                "</when>",
                ") or (subjects_id =3 ",
                "<when test='tsSet12.retrogressType != 1'>",
                "and score_end &lt; ${tsSet32.retrogressScore}",
                "</when>",
                "and year_class_id &lt;&gt; 8) OR ( subjects_id = 3",
                "<when test='tsSet12.retrogressType != 1'>",
                "and score_end &lt; ${tsSet32.retrogressScore}",
                "</when>",
                "and year_class_id = 8 AND t.quarter_num = 4 AND exam_num &lt;&gt; 1) ",
                "or (subjects_id =3 ",
                "<when test='tsSet12.retrogressType != 1'>",
                "and score_end &lt; ${tsSet32.retrogressScore}",
                "</when>",
                "and year_class_id &lt;&gt; 8) OR ( subjects_id = 3",
                "<when test='tsSet12.retrogressType != 1'>",
                "and score_end &lt; ${tsSet32.retrogressScore}",
                "</when>",
                "and year_class_id = 8 AND t.quarter_num &lt;&gt; 4 ) ",
                ")",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                "AND t.school_id IN (${schoolId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
                " THEN 1 ELSE 0 ",
                "  END ",
                "  ) AS retrogress_count,",

                "SUM(CASE WHEN (( is_statistics = 1 AND is_statistics_b = 1 )",
                    "OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 )",
                    "OR ( year_class_id = 8 AND t.quarter_num = 4 AND subjects_id=3 AND is_statistics = 1 )) ",
                    "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                        "AND t.year_class_id IN (${yearClassId}) ",
                    "</when>",
                    "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                        "AND t.school_id IN (${schoolId}) ",
                    "</when>",
                    "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                        "AND t.subjects_id IN (${subjectsId}) ",
                    "</when>",
                    "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                        "AND `course_type_id` in(${courseTypeId}) ",
                    "</when>",
                "THEN 1 ELSE 0 END ) AS stu_reality_count,",

                "SUM(CASE WHEN ",
                " ( ",
                "<when test='tsSet11.includeThree == 0'>",
                " ( year_class_id = 3 and subjects_id=1 AND t.quarter_num = 4 AND exam_num = 1  AND is_statistics = 1 ) or ",
                "</when>",
                "( year_class_id = 8 AND t.quarter_num = 4 AND exam_num = 1  AND subjects_id=3 AND is_statistics = 1 ))",

                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                "AND t.school_id IN (${schoolId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",

                "THEN 1 ELSE 0 END ) AS not_calc_count,",

                "SUM( CASE WHEN (is_statistics = 1 OR is_statistics = 0) ",
                    "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                        "AND t.year_class_id IN (${yearClassId}) ",
                    "</when>",
                    "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
                        "AND t.school_id IN (${schoolId}) ",
                    "</when>",
                    "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                        "AND t.subjects_id IN (${subjectsId}) ",
                    "</when>",
                    "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                        "AND `course_type_id` in(${courseTypeId}) ",
                    "</when>",
                "THEN 1 ELSE 0 END ) AS student_all_count",

                "FROM ",
                "( SELECT * FROM school_quarter WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND deleted = 0) AS t1 ",
                "LEFT JOIN ( ",
            "</if>",

            "<if test= 'type != 6'>",
                "getSchoolName(school_id) as school_name,",

            "SUM(CASE WHEN score_end &lt; ${tsSet11.noPassScore} AND grade_section = 1 AND subjects_id &lt;&gt;3 ",
            "AND ((is_statistics = 1 AND is_statistics_b = 1) OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ))",
            "THEN 1 WHEN (",
            "(score_end &lt; ${tsSet12.noPassScore} and subjects_id &lt;&gt; 3) or (score_end &lt; ${tsSet32.noPassScore} and subjects_id =3)) AND grade_section = 2 ",
            "AND ((is_statistics = 1 AND is_statistics_b = 1 ) OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ))",
            "THEN 1 ELSE 0 END ) AS no_pass_count,",

            "SUM(CASE WHEN score_end &gt;= ${tsSet11.passScore} AND grade_section = 1 AND subjects_id &lt;&gt;3",
            "AND (is_statistics = 1 AND is_statistics_b = 1 OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 )) ",
            "THEN 1 WHEN ((score_end &gt;= ${tsSet12.passScore} and subjects_id &lt;&gt; 3) or (score_end &gt;= ${tsSet32.passScore} and subjects_id =3)) AND grade_section = 2  ",
            "AND ( is_statistics = 1 AND is_statistics_b = 1 OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ) OR (subjects_id = 3 and year_class_id = 8 AND t.quarter_num = 4 and is_statistics =1 ))",
            "THEN 1 ELSE 0 END ) AS pass_count,",

            "SUM(CASE ",
            "<when test='tsSet11.includeThree == 0'>",
            "WHEN score_end &gt;= ${tsSet11.passScore}",
            "AND grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND (",
            "( year_class_id = 3 AND t.quarter_num = 4 AND exam_num = 1  and subjects_id=1 AND is_statistics = 1 )) THEN",
            "1 ",
            "</when>",
            " WHEN ((score_end >= ${tsSet32.passScore} AND subjects_id = 3)) AND grade_section = 2 AND ((year_class_id = 8 AND t.quarter_num = 4 AND exam_num = 1  AND is_statistics = 1 ))",
            "THEN 1 ELSE 0 END ) AS not_calc_pass_count,",

            "SUM(CASE WHEN score_end &gt;= score_start_b and subjects_id &lt;&gt;3 AND grade_section = 1 AND is_statistics = 1 AND is_statistics_b = 1 AND score_end &lt; ${tsSet11.carryScore}  ",
            "THEN 1 ",
            "WHEN score_end &gt;= score_start_b AND grade_section = 2 AND is_statistics = 1 AND is_statistics_b = 1 ",
            "AND ((score_end &lt; ${tsSet12.carryScore} and subjects_id  &lt;&gt;3) or (score_end &lt;${tsSet32.carryScore} and subjects_id =3 and year_class_id &lt;&gt; 8) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND t.quarter_num = 4 AND exam_num &lt;&gt; 1) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND t.quarter_num &lt;&gt; 4)) ",
            "THEN 1 ELSE 0 END ) AS carry_count,",

            "SUM(",
            "CASE",
            " WHEN ",
            "grade_section = 1 ",
            "and score_end &lt; score_start_b ",
            "and subjects_id &lt;&gt;3",
            " AND is_statistics = 1 ",
            " AND is_statistics_b = 1 ",
            "<when test='tsSet11.retrogressType != 1'>",
            "AND score_end &lt; ${tsSet11.retrogressScore}",
            "</when>",
            "  THEN 1",
            "WHEN",
            "grade_section = 2 ",
            "and score_end &lt; score_start_b ",
            "  AND is_statistics = 1 ",
            "  AND is_statistics_b = 1 ",
            " AND ((subjects_id  &lt;&gt;3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet12.retrogressScore}",
            "</when>",
            ") or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.retrogressScore}",
            "</when>",
            "and year_class_id &lt;&gt; 8) OR ( subjects_id = 3",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.retrogressScore}",
            "</when>",
            "and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1)",
            "or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.retrogressScore}",
            "</when>",
            "and year_class_id &lt;&gt; 8) OR ( subjects_id = 3",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.retrogressScore}",
            "</when>",
            "and year_class_id = 8 AND quarter_num &lt;&gt; 4)",
            ") THEN  1 ELSE 0 ",
            "  END ",
            "  ) AS retrogress_count,",

            "SUM(CASE WHEN (( is_statistics = 1 AND is_statistics_b = 1 )",
            "OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 )",
            "OR ( year_class_id = 8 AND t.quarter_num = 4 AND subjects_id=3 AND is_statistics = 1 )) ",
            "THEN 1 ELSE 0 END ) AS stu_reality_count,",

            "SUM(CASE WHEN ",
            "<when test='tsSet11.includeThree == 0'>",
            "( year_class_id = 3 and subjects_id=1 AND t.quarter_num = 4 AND exam_num = 1  AND is_statistics = 1 ) or ",
            "</when>",
            "( year_class_id = 8 AND t.quarter_num = 4 AND exam_num = 1  AND subjects_id=3 AND is_statistics = 1 )",
            "THEN 1 ELSE 0 END ) AS not_calc_count,",

            "SUM( CASE WHEN (is_statistics = 1 OR is_statistics = 0) ",
            "THEN 1 ELSE 0 END ) AS student_all_count",

            "FROM (",
            "</if>",

            "<foreach collection='tsSetList' item='item' open='' separator='UNION all' close=''>",
            "SELECT",
            "t01.*,",
            "t02.exam_num,",
            "IFNULL( t02.score, 0 ) score,",
            "IFNULL( t02.score_start, 0 ) score_start,",
            "IFNULL( t02.score_end, 0 ) score_end,",
            "IFNULL( t02.is_statistics, 0 ) is_statistics,",
            "IFNULL( t03.score, 0 ) score_b,",
            "IFNULL( t03.score_start, 0 ) score_start_b,",
            "IFNULL( t03.score_end, 0 ) score_end_b,",
            "IFNULL( t03.is_statistics, 0 ) is_statistics_b ",
            "FROM",
            "(",
            "SELECT",
            "s01.school_id,",
            "s01.subjects_id,",
            "s01.student_id,",
            "s01.year_part,",
            "s01.quarter_num,",
            "s01.year_class_id,",
            "s01.grade_id,",
            "getGradeSectionForYearClassId ( s01.year_class_id ) AS grade_section,",
            "s02.teacher_id, ",
            "s02.course_type_id ",
            "FROM",
            "student_grade AS s01",
            "LEFT JOIN grade AS s02 ON s01.grade_id = s02.id ",
            "WHERE",
            "s01.year_part = ${yearPart} ",
            "AND s01.quarter_num = ${quarterNum} ",
            "AND s01.is_last = 1 ",
            "AND s01.deleted = 0 ",
            "AND s01.`status` =1 ",
            "and s02.year_class_id in (${item.yearClassIdStr})",
            "and s02.subjects_id in(${item.subjectsIdStr})",
            "AND s01.`reading_status` in (1,5,6) ",
            "AND s01.lesson_type = 1 ",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",

            "<if test= 'type == 3'>",
            "AND s02.teacher_id in(select admin_id from role_admin where role_id = 1568160887369994242) ",
            "</if>",

            "<if test= 'type != 6'>",
            "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
            "AND s02.year_class_id IN (${yearClassId}) ",
            "</when>",
            "<when test='schoolId!=null and schoolId!=&apos;&apos;'>",
            "AND s02.school_id IN (${schoolId}) ",
            "</when>",
            "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
            "AND s02.subjects_id IN (${subjectsId}) ",
            "</when>",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",
            "</if>",

            "<when test='yearClassId==null or yearClassId==&apos;&apos;'>",
            "and s02.year_class_id IN (3, 4, 5, 6, 7, 8, 9) ",
            "</when>",
            "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
            "AND s02.subjects_id IN (${subjectsId}) ",
            "</when>",

            "GROUP BY",
            "student_id,",
            "subjects_id ",
            ") AS t01",
            "<if test='include == 0'>",
            "INNER JOIN (select * from record_course where year_part = ${yearPart} AND `quarter`= ${quarterNum} and lesson_type = 1 and course_type in (1,4) and lesson_num = 1 and deleted = 0 GROUP BY student_id,subjects_id) as t04 on t01.student_id = t04.student_id and t01.subjects_id = t04.subjects_id",
            "</if>",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND exam_num = ${examNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t02 ON t01.student_id = t02.student_id ",
            "AND t01.subjects_id = t02.subjects_id",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${item.upYearPart} AND quarter_num = ${item.upQuarterNum} AND exam_num = ${item.upExamNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t03 ON t01.student_id = t03.student_id ",
            "AND t01.subjects_id = t03.subjects_id ",
            "LEFT JOIN transcript_exclude AS t05 ON t05.student_id = t01.student_id AND t05.subjects_id = t01.subjects_id AND t05.year_part = t01.year_part AND t05.quarter_num = t01.quarter_num AND t05.exam_num = t02.exam_num",
            "WHERE t05.id IS NULL ",
            "</foreach>",
            "<if test= 'type != 6 '>",
                ") AS t ",
            "</if>",
            "<if test= 'type == 6 '>",
                ") AS t ON t1.school_id = t.school_id ",
            "</if>",

            "WHERE 1=1 AND t.school_id IS NOT NULL ",
            "GROUP BY ",
            "<if test= 'type == 1 '>",
            "teacher_id ",
            "</if>",
            "<if test= 'type == 2 '>",
            "teacher_id,school_id ",
            "</if>",
            "<if test= 'type == 3 '>",
            "teacher_id ",
            "</if>",
            "<if test= 'type == 4 or type == 6'>",
            "t.school_id ",
            "</if>",
            "</script>"
    })
    public List<ScoreData> scoreData(@Param("yearPart") Integer yearPart, @Param("quarterNum") Integer quarterNum, @Param("examNum") Integer examNum, @Param("include") Integer include, @Param("courseTypeId") String courseTypeId, @Param("yearClassId") String yearClassId, @Param("subjectsId") String subjectsId, @Param("schoolId") String schoolId, @Param("type") String type, @Param("tsSet11") TranscriptSafetyScoreSet tsSet11, @Param("tsSet12") TranscriptSafetyScoreSet tsSet12, @Param("tsSet21") TranscriptSafetyScoreSet tsSet21, @Param("tsSet22") TranscriptSafetyScoreSet tsSet22, @Param("tsSet32") TranscriptSafetyScoreSet tsSet32, @Param("tsSetList") List<TranscriptSafetyDiffSet> tsSetList);

    @Select({"<script>",
            "SELECT",
            "*,",
            "getStaffNameForId ( teacher_id ) AS teacher_name,",
            "getSchoolName ( school_id ) AS school_name,",
            "getDictName(year_class_id, 14) as year_class_name",
            "FROM",
            "(",
            "<foreach collection='tsSetList' item='item' open='' separator='UNION all' close=''>",
            "SELECT",
            "t01.*,",
            "t02.exam_num,",
            "IFNULL( t02.score, 0 ) score,",
            "IFNULL( t02.score_start, 0 ) score_start,",
            "IFNULL( t02.score_end, 0 ) score_end,",
            "IFNULL( t02.is_statistics, 0 ) is_statistics,",
            "IFNULL( t03.score, 0 ) score_b,",
            "IFNULL( t03.score_start, 0 ) score_start_b,",
            "IFNULL( t03.score_end, 0 ) score_end_b,",
            "IFNULL( t03.is_statistics, 0 ) is_statistics_b ",
            "FROM",
            "(",
            "SELECT",
            "s01.school_id,",
            "s01.subjects_id,",
            "s01.student_id,",
            "s01.year_part,",
            "s01.quarter_num,",
            "s01.year_class_id,",
            "s01.grade_id,",
            "getGradeSectionForYearClassId ( s01.year_class_id ) AS grade_section,",
            "s02.teacher_id,",
            "s03.`name` as student_name,",
            "s03.linkman_phone ",
            "FROM",
            "student_grade AS s01",
            "LEFT JOIN grade AS s02 ON s01.grade_id = s02.id ",
            "LEFT JOIN student AS s03 ON s01.student_id = s03.id",
            "WHERE",
            "s01.year_part = ${yearPart} ",
            "AND s01.quarter_num = ${quarterNum} ",
            "AND s01.is_last = 1 ",
            "AND s01.deleted = 0 ",
            "AND s01.`status` =1 ",
            "and s02.year_class_id in(${item.yearClassIdStr})",
            "and s02.subjects_id in(${item.subjectsIdStr})",
            "AND s01.`reading_status` in (1,5,6) ",
            "AND s01.lesson_type = 1 ",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",
            "<when test='studentName!=null and studentName!=&apos;&apos; '>",
            "AND s03.`name` like '%${studentName}%'",
            "</when>",
            "GROUP BY",
            "student_id,",
            "subjects_id ",
            ") AS t01",
            "<if test='include == 0'>",
            "INNER JOIN (select * from record_course where year_part = ${yearPart} AND `quarter`= ${quarterNum} and lesson_type = 1 and course_type in (1,4) and lesson_num = 1 and deleted = 0 GROUP BY student_id,subjects_id) as t04 on t01.student_id = t04.student_id and t01.subjects_id = t04.subjects_id",
            "</if>",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND exam_num = ${examNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t02 ON t01.student_id = t02.student_id ",
            "AND t01.subjects_id = t02.subjects_id",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${item.upYearPart} AND quarter_num = ${item.upQuarterNum} AND exam_num = ${item.upExamNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t03 ON t01.student_id = t03.student_id ",
            "AND t01.subjects_id = t03.subjects_id ",
            "LEFT JOIN transcript_exclude AS t05 ON t05.student_id = t01.student_id AND t05.subjects_id = t01.subjects_id AND t05.year_part = t01.year_part AND t05.quarter_num = t01.quarter_num AND t05.exam_num = t02.exam_num",
            "WHERE t05.id IS NULL ",
            "</foreach>",
            ") AS t",
            "${ew.customSqlSegment}",
            "</script>"})
    public IPage<ScoreDataDetail> scoreDataDetail(IPage<?> page, @Param("yearPart") Integer yearPart, @Param("quarterNum") Integer quarterNum, @Param("examNum") Integer examNum, @Param("upYearPart") Integer upYearPart, @Param("upQuarterNum") Integer upQuarterNum, @Param("upExamNum") Integer upExamNum, @Param("include") Integer include, @Param("studentName") String studentName, @Param("courseTypeId") String courseTypeId, @Param(Constants.WRAPPER) Wrapper wrapper, @Param("tsSet11") TranscriptSafetyScoreSet tsSet11,@Param("tsSet12") TranscriptSafetyScoreSet tsSet12,@Param("tsSet21") TranscriptSafetyScoreSet tsSet21,@Param("tsSet22") TranscriptSafetyScoreSet tsSet22,@Param("tsSet32") TranscriptSafetyScoreSet tsSet32, @Param("tsSetList") List<TranscriptSafetyDiffSet> tsSetList);

    @Select({
            "<script>",
            "SELECT",
            "*,",
            "getStaffNameForId(t1.teacher_id) as teacher_name,",
            "getSchoolName(t.school_id) as school_name,",

            "SUM(CASE WHEN score_end &lt; ${tsSet11.noPassScore} AND grade_section = 1 AND subjects_id &lt;&gt;3 ",
            "AND ((is_statistics = 1 AND is_statistics_b = 1) OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ))",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 WHEN (",
            "(score_end &lt; ${tsSet12.noPassScore} and subjects_id &lt;&gt; 3) or (score_end &lt; ${tsSet32.noPassScore} and subjects_id =3)) AND grade_section = 2 ",
            "AND ((is_statistics = 1 AND is_statistics_b = 1 ) OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ))",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 ELSE 0 END ) AS no_pass_count,",

            "SUM(CASE WHEN score_end &gt;= ${tsSet11.passScore} AND grade_section = 1 AND subjects_id &lt;&gt;3",
            "AND (is_statistics = 1 AND is_statistics_b = 1 OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 )) ",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 WHEN ((score_end &gt;= ${tsSet12.passScore} and subjects_id &lt;&gt; 3) or (score_end &gt;= ${tsSet32.passScore} and subjects_id =3)) AND grade_section = 2  ",
            "AND ( is_statistics = 1 AND is_statistics_b = 1 OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 ) OR (subjects_id = 3 and year_class_id = 8 AND t.quarter_num = 4 and is_statistics =1 ))",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 ELSE 0 END ) AS pass_count,",

            "SUM(CASE ",
            "<when test='tsSet11.includeThree == 0'>",
            "WHEN score_end &gt;= ${tsSet11.passScore}",
            "AND grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND (",
            "( year_class_id = 3 AND quarter_num = 4 AND exam_num = 1  and subjects_id=1 AND is_statistics = 1 )) THEN",
            "1 ",
            "</when>",
            "WHEN (",
            "(score_end >= ${tsSet32.passScore} AND subjects_id = 3)) AND grade_section = 2 AND ((year_class_id = 8 AND t.quarter_num = 4 AND exam_num = 1  AND is_statistics = 1 ))",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 ELSE 0 END ) AS not_calc_pass_count,",

            "SUM(CASE WHEN score_end &gt;= score_start_b and subjects_id &lt;&gt;3 AND grade_section = 1 AND is_statistics = 1 AND is_statistics_b = 1 AND score_end &lt; ${tsSet11.carryScore}  ",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 ",
            "WHEN score_end &gt;= score_start_b AND grade_section = 2 AND is_statistics = 1 AND is_statistics_b = 1 ",
            "AND ((score_end &lt; ${tsSet12.carryScore} and subjects_id  &lt;&gt;3) or (score_end &lt; ${tsSet32.carryScore} and subjects_id =3 and year_class_id &lt;&gt; 8) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND t.quarter_num = 4 AND exam_num &lt;&gt; 1) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND t.quarter_num &lt;&gt; 4 )) ",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 ELSE 0 END ) AS carry_count,",

            "SUM(",
            "CASE",
            " WHEN ",
            "grade_section = 1 ",
            "and score_end &lt; score_start_b ",
            "and subjects_id &lt;&gt;3",
            " AND is_statistics = 1 ",
            " AND is_statistics_b = 1 ",
            "<when test='tsSet11.retrogressType != 1'>",
            "AND score_end &lt; ${tsSet11.retrogressScore}",
            "</when>",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "  THEN 1",
            "WHEN",
            "grade_section = 2 ",
            "and score_end &lt; score_start_b ",
            "  AND is_statistics = 1 ",
            "  AND is_statistics_b = 1 ",
            " AND ((subjects_id  &lt;&gt;3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet12.retrogressScore}",
            "</when>",
            ") or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.retrogressScore}",
            "</when>",
            "and year_class_id &lt;&gt; 8) OR ( subjects_id = 3",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.retrogressScore}",
            "</when>",
            "and year_class_id = 8 AND t.quarter_num = 4 AND exam_num &lt;&gt; 1) ",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            " or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
                "and score_end &lt; ${tsSet32.retrogressScore}",
            "</when>",
            "and year_class_id &lt;&gt; 8) OR ( subjects_id = 3",
            "<when test='tsSet12.retrogressType != 1'>",
                "and score_end &lt; ${tsSet32.retrogressScore}",
            "</when>",
            "and year_class_id = 8 AND t.quarter_num &lt;&gt; 4)) ",
            "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                "AND t.year_class_id IN (${yearClassId}) ",
            "</when>",
            "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                "AND t.subjects_id IN (${subjectsId}) ",
            "</when>",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                "AND `course_type_id` in(${courseTypeId}) ",
            "</when>",
            " THEN 1 ELSE 0 ",
            "  END ",
            "  ) AS retrogress_count,",

            "SUM(CASE WHEN (( is_statistics = 1 AND is_statistics_b = 1 )",
            "OR ( year_class_id = 3 AND t.quarter_num = 4 AND is_statistics = 1 )",
            "OR ( year_class_id = 8 AND t.quarter_num = 4 AND subjects_id=3 AND is_statistics = 1 )) ",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 ELSE 0 END ) AS stu_reality_count,",

            "SUM(CASE WHEN ",
            "<when test='tsSet11.includeThree == 0'>",
                "( year_class_id = 3 and subjects_id=1 AND quarter_num = 4 AND exam_num = 1  AND is_statistics = 1 ) or ",
            "</when>",
            " ( year_class_id = 8 AND t.quarter_num = 4 AND exam_num = 1  AND subjects_id=3 AND is_statistics = 1 )",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 ELSE 0 END ) AS not_calc_count,",

            "SUM( CASE WHEN (is_statistics = 1 OR is_statistics = 0) ",
                "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
                    "AND t.year_class_id IN (${yearClassId}) ",
                "</when>",
                "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
                    "AND t.subjects_id IN (${subjectsId}) ",
                "</when>",
                "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
                    "AND `course_type_id` in(${courseTypeId}) ",
                "</when>",
            "THEN 1 ELSE 0 END ) AS student_all_count",

            "FROM (",
            "SELECT ",
            "td.*,td.sourse_id as teacher_id ,tm.team_name,tm.id AS team_id,tm.pid AS team_pid ",
            "FROM ",
            "track_market AS tm ",
            "LEFT JOIN track_detail AS td ON tm.id = td.track_id ",
            "AND tm.deleted = td.deleted ",
            "WHERE ",
            "tm.classify = ${classify} ",
            "AND tm.track_type = ${trackType} ",
            "AND tm.`status` = 1 ",
            "AND tm.deleted = 0 ",
            "AND tm.year_part = ${yearPart} ",
            "AND tm.quarter_num = ${quarterNum} ",
            "<when test='teamId!=null and teamId!=&apos;&apos; '>",
            "and tm.id IN (${teamId}) ",
            "</when>",
            "GROUP BY ",
            "tm.id,td.sourse_id ",
            ") AS t1 ",
            "LEFT JOIN (",
            "<foreach collection='tsSetList' item='item' open='' separator='UNION all' close=''>",
            "SELECT",
            "t01.*,",
            "t02.exam_num,",
            "IFNULL( t02.score, 0 ) score,",
            "IFNULL( t02.score_start, 0 ) score_start,",
            "IFNULL( t02.score_end, 0 ) score_end,",
            "IFNULL( t02.is_statistics, 0 ) is_statistics,",
            "IFNULL( t03.score, 0 ) score_b,",
            "IFNULL( t03.score_start, 0 ) score_start_b,",
            "IFNULL( t03.score_end, 0 ) score_end_b,",
            "IFNULL( t03.is_statistics, 0 ) is_statistics_b ",
            "FROM",
            "(",
            "SELECT",
            "s01.school_id,",
            "s01.subjects_id,",
            "s01.student_id,",
            "s01.year_part,",
            "s01.quarter_num,",
            "s01.year_class_id,",
            "s01.grade_id,",
            "getGradeSectionForYearClassId ( s01.year_class_id ) AS grade_section,",
            "s02.teacher_id, ",
            "s02.course_type_id ",
            "FROM",
            "student_grade AS s01",
            "LEFT JOIN grade AS s02 ON s01.grade_id = s02.id ",
            "WHERE",
            "s01.year_part = ${yearPart} ",
            "AND s01.quarter_num = ${quarterNum} ",
            "AND s01.is_last = 1 ",
            "AND s01.deleted = 0 ",
            "AND s01.`status` =1 ",
            "and s02.year_class_id in(${item.yearClassIdStr})",
            "and s02.subjects_id in(${item.subjectsIdStr})",
            "AND s01.`reading_status` in (1,5,6) ",
            "AND s01.lesson_type = 1 ",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",
            "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
            "AND s02.subjects_id IN (${subjectsId}) ",
            "</when>",
            "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
            "AND s02.year_class_id IN (${yearClassId}) ",
            "</when>",
            "GROUP BY",
            "student_id,",
            "subjects_id ",
            ") AS t01",
            "<if test='include == 0'>",
                "INNER JOIN (select * from record_course where year_part = ${yearPart} AND `quarter`= ${quarterNum} and lesson_type = 1 and course_type in (1,4) and lesson_num = 1 and deleted = 0 GROUP BY student_id,subjects_id) as t04 on t01.student_id = t04.student_id and t01.subjects_id = t04.subjects_id",
            "</if>",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND exam_num = ${examNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t02 ON t01.student_id = t02.student_id ",
            "AND t01.subjects_id = t02.subjects_id",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${item.upYearPart} AND quarter_num = ${item.upQuarterNum} AND exam_num = ${item.upExamNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t03 ON t01.student_id = t03.student_id ",
            "AND t01.subjects_id = t03.subjects_id ",
            "LEFT JOIN transcript_exclude AS t05 ON t05.student_id = t01.student_id AND t05.subjects_id = t01.subjects_id AND t05.year_part = t01.year_part AND t05.quarter_num = t01.quarter_num AND t05.exam_num = t02.exam_num",
            "WHERE t05.id IS NULL ",
            "</foreach>",
            ") AS t ON t.teacher_id = t1.teacher_id ",
            "AND ( find_in_set( t.year_class_id, t1.year_class_id_str ) OR t1.year_class_id_str = '' ) ",
            "AND ( find_in_set( t.school_id, t1.school_id_str ) OR t1.school_id_str = '' ) ",
            "GROUP BY ",
            "team_id ",
            "<when test='teamId!=null and teamId!=&apos;&apos; '>",
                ",t.teacher_id ",
                "HAVING t.teacher_id IS NOT NULL",
            "</when>",
            "</script>"
    })
    public List<ScoreData> scoreTeamData(@Param("yearPart") Integer yearPart, @Param("quarterNum") Integer quarterNum, @Param("examNum") Integer examNum, @Param("upYearPart") Integer upYearPart, @Param("upQuarterNum") Integer upQuarterNum, @Param("upExamNum") Integer upExamNum, @Param("include") Integer include, @Param("courseTypeId") String courseTypeId, @Param("yearClassId") String yearClassId, @Param("subjectsId") String subjectsId, @Param("classify") String classify, @Param("trackType") String trackType, @Param("teamId") String teamId, @Param("tsSet11") TranscriptSafetyScoreSet tsSet11, @Param("tsSet12") TranscriptSafetyScoreSet tsSet12, @Param("tsSet21") TranscriptSafetyScoreSet tsSet21, @Param("tsSet22") TranscriptSafetyScoreSet tsSet22, @Param("tsSet32") TranscriptSafetyScoreSet tsSet32, @Param("tsSetList") List<TranscriptSafetyDiffSet> tsSetList);

    @Select({"<script>",
            "SELECT",
            "t.*,",
            "getStaffNameForId ( t.teacher_id ) AS teacher_name,",
            "getSchoolName ( t.school_id ) AS school_name,",
            "getDictName(t.year_class_id, 14) as year_class_name",

            "FROM",
            "( ",
            "SELECT ",
            "td.*,td.sourse_id as teacher_id ,tm.team_name,tm.id AS team_id,tm.pid AS team_pid ",
            "FROM ",
            "track_market AS tm ",
            "LEFT JOIN track_detail AS td ON tm.id = td.track_id ",
            "AND tm.deleted = td.deleted ",
            "WHERE ",
            "tm.classify = ${classify} ",
            "AND tm.track_type = ${trackType} ",
            "AND tm.`status` = 1 ",
            "AND tm.deleted = 0 ",
            "AND tm.year_part = ${yearPart} ",
            "AND tm.quarter_num = ${quarterNum} ",
            "<when test='teamId!=null and teamId!=&apos;&apos; '>",
            "and tm.id IN (${teamId}) ",
            "</when>",
            "GROUP BY ",
            "tm.id,td.sourse_id ",
            ") AS t1 ",
            "LEFT JOIN (",
            "<foreach collection='tsSetList' item='item' open='' separator='UNION all' close=''>",
            "SELECT",
            "t01.*,",
            "t02.exam_num,",
            "IFNULL( t02.score, 0 ) score,",
            "IFNULL( t02.score_start, 0 ) score_start,",
            "IFNULL( t02.score_end, 0 ) score_end,",
            "IFNULL( t02.is_statistics, 0 ) is_statistics,",
            "IFNULL( t03.score, 0 ) score_b,",
            "IFNULL( t03.score_start, 0 ) score_start_b,",
            "IFNULL( t03.score_end, 0 ) score_end_b,",
            "IFNULL( t03.is_statistics, 0 ) is_statistics_b ",
            "FROM",
            "(",
            "SELECT",
            "s01.school_id,",
            "s01.subjects_id,",
            "s01.student_id,",
            "s01.year_part,",
            "s01.quarter_num,",
            "s01.year_class_id,",
            "s01.grade_id,",
            "getGradeSectionForYearClassId ( s01.year_class_id ) AS grade_section,",
            "s02.teacher_id,",
            "s03.`name` as student_name,",
            "s03.linkman_phone ",
            "FROM",
            "student_grade AS s01",
            "LEFT JOIN grade AS s02 ON s01.grade_id = s02.id ",
            "LEFT JOIN student AS s03 ON s01.student_id = s03.id",
            "WHERE",
            "s01.year_part = ${yearPart} ",
            "AND s01.quarter_num = ${quarterNum} ",
            "AND s01.is_last = 1 ",
            "AND s01.deleted = 0 ",
            "AND s01.`status` =1 ",
            "and s02.year_class_id in(${item.yearClassIdStr})",
            "and s02.subjects_id in(${item.subjectsIdStr})",
            "AND s01.`reading_status` in (1,5,6) ",
            "AND s01.lesson_type = 1 ",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",
            "<when test='subjectsId!=null and subjectsId!=&apos;&apos;'>",
            "AND s02.subjects_id IN (${subjectsId}) ",
            "</when>",
            "<when test='yearClassId!=null and yearClassId!=&apos;&apos;'>",
            "AND s02.year_class_id IN (${yearClassId}) ",
            "</when>",

            "<when test='teacherId!=null and teacherId!=&apos;&apos;'>",
            "AND s02.teacher_id = ${teacherId} ",
            "</when>",
            "<when test='gradeId!=null and gradeId!=&apos;&apos;'>",
            "AND s02.id =${gradeId}",
            "</when>",

            "<when test='studentName!=null and studentName!=&apos;&apos; '>",
            "AND s03.`name` like '%${studentName}%'",
            "</when>",
            "GROUP BY",
            "student_id,",
            "subjects_id ",
            ") AS t01",
            "<if test='include == 0'>",
            "INNER JOIN (select * from record_course where year_part = ${yearPart} AND `quarter`= ${quarterNum} and lesson_type = 1 and course_type in (1,4) and lesson_num = 1 and deleted = 0 GROUP BY student_id,subjects_id) as t04 on t01.student_id = t04.student_id and t01.subjects_id = t04.subjects_id",
            "</if>",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND exam_num = ${examNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t02 ON t01.student_id = t02.student_id ",
            "AND t01.subjects_id = t02.subjects_id",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${item.upYearPart} AND quarter_num = ${item.upQuarterNum} AND exam_num = ${item.upExamNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t03 ON t01.student_id = t03.student_id ",
            "AND t01.subjects_id = t03.subjects_id ",
            "LEFT JOIN transcript_exclude AS t05 ON t05.student_id = t01.student_id AND t05.subjects_id = t01.subjects_id AND t05.year_part = t01.year_part AND t05.quarter_num = t01.quarter_num AND t05.exam_num = t02.exam_num",
            "WHERE t05.id IS NULL ",
            "</foreach>",
            ") AS t ON t.teacher_id = t1.teacher_id ",
            "AND ( find_in_set( t.year_class_id, t1.year_class_id_str ) OR t1.year_class_id_str = '' ) ",
            "AND ( find_in_set( t.school_id, t1.school_id_str ) OR t1.school_id_str = '' ) ",
            "${ew.customSqlSegment}",
            "</script>"})
    public IPage<ScoreDataDetail> scoreDataTeamDetail(IPage<?> page, @Param("yearPart") Integer yearPart, @Param("quarterNum") Integer quarterNum, @Param("examNum") Integer examNum, @Param("upYearPart") Integer upYearPart, @Param("upQuarterNum") Integer upQuarterNum, @Param("upExamNum") Integer upExamNum, @Param("include") Integer include, @Param("studentName") String studentName, @Param("courseTypeId") String courseTypeId, @Param("yearClassId") String yearClassId, @Param("subjectsId") String subjectsId,@Param("gradeId") String gradeId,@Param("teacherId") String teacherId, @Param("classify") String classify,@Param("trackType") String trackType,@Param("teamId") String teamId, @Param(Constants.WRAPPER) Wrapper wrapper, @Param("tsSet11") TranscriptSafetyScoreSet tsSet11,@Param("tsSet12") TranscriptSafetyScoreSet tsSet12,@Param("tsSet21") TranscriptSafetyScoreSet tsSet21,@Param("tsSet22") TranscriptSafetyScoreSet tsSet22,@Param("tsSet32") TranscriptSafetyScoreSet tsSet32,@Param("tsSetList") List<TranscriptSafetyDiffSet> tsSetList);


    /**
     * 提分、退步详情
     */
    @Select({"<script>",
            "SELECT",
            "*,",
            "getStaffNameForId ( teacher_id ) AS teacher_name,",
            "getSchoolName ( school_id ) AS school_name,",
            "getDictName ( year_class_id, 14 ) AS year_class_name ",
            "FROM",
            "(",
            "SELECT",
            "*,",
            "CASE",
            "",
            "WHEN score_end &gt;= score_start_b ",
            "AND grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "AND score_end &lt; ${tsSet11.carryScore} THEN 1",
            "WHEN score_end &gt;= score_start_b ",
            "AND grade_section = 2 ",
            "AND ((score_end &lt; ${tsSet12.carryScore} and subjects_id &lt;&gt;3) or (score_end &lt;${tsSet32.carryScore} and subjects_id =3 and year_class_id &lt;&gt; 8) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND quarter_num &lt;&gt; 4 ) ) THEN",
            "1 ELSE 0 ",
            "END AS pass_count,",
            "CASE",
            "",
            "WHEN grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "AND score_end &lt; ${tsSet11.passScore} ",
            "</when>",
            "THEN",
            "score_end - score_start_b ",
            "WHEN grade_section = 2 ",
            "AND ((subjects_id &lt;&gt;3",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet12.passScore} ",
            "</when>",
            ") or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id &lt;&gt; 8) OR (subjects_id = 3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1)",
            "or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id &lt;&gt; 8) OR (subjects_id = 3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id = 8 AND quarter_num &lt;&gt; 4)",
            ") THEN",
            "score_end - score_start_b ELSE 0",
            "END AS diff_score ",
            "FROM",
            "(",
            "<foreach collection='tsSetList' item='item' open='' separator='UNION all' close=''>",
            "SELECT",
            "t01.*,",
            "t02.exam_num,",
            "IFNULL( t02.score, 0 ) score,",
            "IFNULL( t02.score_start, 0 ) score_start,",
            "IFNULL( t02.score_end, 0 ) score_end,",
            "IFNULL( t02.is_statistics, 0 ) is_statistics,",
            "IFNULL( t03.score, 0 ) score_b,",
            "IFNULL( t03.score_start, 0 ) score_start_b,",
            "IFNULL( t03.score_end, 0 ) score_end_b,",
            "IFNULL( t03.is_statistics, 0 ) is_statistics_b ",
            "FROM",
            "(",
            "SELECT",
            "s01.school_id,",
            "s01.subjects_id,",
            "s01.student_id,",
            "s01.year_part,",
            "s01.quarter_num,",
            "s01.year_class_id,",
            "s01.grade_id,",
            "getGradeSectionForYearClassId ( s01.year_class_id ) AS grade_section,",
            "s02.teacher_id,",
            "s03.`name` AS student_name, ",
            "s03.linkman_phone ",
            "FROM",
            "student_grade AS s01",
            "LEFT JOIN grade AS s02 ON s01.grade_id = s02.id",
            "LEFT JOIN student AS s03 ON s01.student_id = s03.id ",
            "WHERE",
            "s01.year_part = ${yearPart} ",
            "AND s01.quarter_num = ${quarterNum} ",
            "AND s01.is_last = 1 ",
            "AND s01.deleted = 0 ",
            "AND s01.`status` =1 ",
            "and s02.year_class_id in(${item.yearClassIdStr})",
            "and s02.subjects_id in(${item.subjectsIdStr})",
            "AND s01.`reading_status` in (1,5,6) ",
            "AND s01.lesson_type = 1 ",
            "<when test='studentName!=null and studentName!=&apos;&apos; '>",
            "AND s03.`name` like '%${studentName}%'",
            "</when>",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",
            "GROUP BY",
            "student_id,",
            "subjects_id ",
            ") AS t01",
            "<if test='include == 0'>",
            "INNER JOIN (select * from record_course where year_part = ${yearPart} AND `quarter`= ${quarterNum} and lesson_type = 1 and course_type in (1,4) and lesson_num = 1 and deleted = 0 GROUP BY student_id,subjects_id) as t04 on t01.student_id = t04.student_id and t01.subjects_id = t04.subjects_id",
            "</if>",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND exam_num = ${examNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t02 ON t01.student_id = t02.student_id ",
            "AND t01.subjects_id = t02.subjects_id",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${item.upYearPart} AND quarter_num = ${item.upQuarterNum} AND exam_num = ${item.upExamNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t03 ON t01.student_id = t03.student_id ",
            "AND t01.subjects_id = t03.subjects_id ",
            "LEFT JOIN transcript_exclude AS t05 ON t05.student_id = t01.student_id AND t05.subjects_id = t01.subjects_id AND t05.year_part = t01.year_part AND t05.quarter_num = t01.quarter_num AND t05.exam_num = t02.exam_num",
            "WHERE t05.id IS NULL ",
            "</foreach>",
            ") AS t1 ",
            ") AS t",
            "${ew.customSqlSegment}",
            "</script>"})
    public IPage<ScoreDataDetail> carrySoreDataDetail(IPage<?> page, @Param("yearPart") Integer yearPart, @Param("quarterNum") Integer quarterNum, @Param("examNum") Integer examNum, @Param("include") Integer include, @Param("studentName") String studentName,@Param("courseTypeId") String courseTypeId, @Param(Constants.WRAPPER) Wrapper wrapper, @Param("tsSet11") TranscriptSafetyScoreSet tsSet11,@Param("tsSet12") TranscriptSafetyScoreSet tsSet12,@Param("tsSet21") TranscriptSafetyScoreSet tsSet21,@Param("tsSet22") TranscriptSafetyScoreSet tsSet22,@Param("tsSet32") TranscriptSafetyScoreSet tsSet32, @Param("tsSetList") List<TranscriptSafetyDiffSet> tsSetList);

    /**
     * 战队提分、退步详情
     */
    @Select({"<script>",
            "SELECT",
            "*,",
            "getStaffNameForId ( teacher_id ) AS teacher_name,",
            "getSchoolName ( school_id ) AS school_name,",
            "getDictName ( year_class_id, 14 ) AS year_class_name ",
            "FROM",
            "(",
            "SELECT",
            "t2.*,",
            "CASE",
            "",
            "WHEN score_end &gt;= score_start_b ",
            "AND grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "AND score_end &lt; ${tsSet11.carryScore} THEN 1",
            "WHEN score_end &gt;= score_start_b ",
            "AND grade_section = 2 ",
            "AND ((score_end &lt; ${tsSet12.carryScore} and subjects_id &lt;&gt;3) or (score_end &lt;${tsSet32.carryScore} and subjects_id =3 and year_class_id &lt;&gt; 8) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1) OR ( score_end &lt; ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND quarter_num &lt;&gt; 4 )) THEN",
            "1 ELSE 0 ",
            "END AS pass_count,",
            "CASE",
            "",
            "WHEN grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "AND score_end &lt; ${tsSet11.passScore} ",
            "</when>",
            "THEN",
            "score_end - score_start_b ",
            "WHEN grade_section = 2 ",
            "AND ((subjects_id &lt;&gt;3",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet12.passScore} ",
            "</when>",
            ") or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id &lt;&gt; 8) OR (subjects_id = 3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1)",
            "or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id &lt;&gt; 8) OR (subjects_id = 3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id = 8 AND quarter_num &lt;&gt; 4 )",

            ") THEN",
            "score_end - score_start_b ELSE 0",
            "END AS diff_score ",
            "FROM (",
            "SELECT ",
            "td.*,td.sourse_id as teacher_id ,tm.team_name,tm.id AS team_id,tm.pid AS team_pid ",
            "FROM ",
            "track_market AS tm ",
            "LEFT JOIN track_detail AS td ON tm.id = td.track_id ",
            "AND tm.deleted = td.deleted ",
            "WHERE ",
            "tm.classify = ${classify} ",
            "AND tm.track_type = ${trackType} ",
            "AND tm.`status` = 1 ",
            "AND tm.deleted = 0 ",
            "AND tm.year_part = ${yearPart} ",
            "AND tm.quarter_num = ${quarterNum} ",
            "<when test='teamId!=null and teamId!=&apos;&apos; '>",
            "and tm.id IN (${teamId}) ",
            "</when>",
            "GROUP BY ",
            "tm.id,td.sourse_id ",
            ") AS t1 ",
            "LEFT JOIN (",
            "<foreach collection='tsSetList' item='item' open='' separator='UNION all' close=''>",
            "SELECT",
            "t01.*,",
            "t02.exam_num,",
            "IFNULL( t02.score, 0 ) score,",
            "IFNULL( t02.score_start, 0 ) score_start,",
            "IFNULL( t02.score_end, 0 ) score_end,",
            "IFNULL( t02.is_statistics, 0 ) is_statistics,",
            "IFNULL( t03.score, 0 ) score_b,",
            "IFNULL( t03.score_start, 0 ) score_start_b,",
            "IFNULL( t03.score_end, 0 ) score_end_b,",
            "IFNULL( t03.is_statistics, 0 ) is_statistics_b ",
            "FROM",
            "(",
            "SELECT",
            "s01.school_id,",
            "s01.subjects_id,",
            "s01.student_id,",
            "s01.year_part,",
            "s01.quarter_num,",
            "s01.year_class_id,",
            "s01.grade_id,",
            "getGradeSectionForYearClassId ( s01.year_class_id ) AS grade_section,",
            "s02.teacher_id,",
            "s03.`name` AS student_name, ",
            "s03.linkman_phone ",
            "FROM",
            "student_grade AS s01",
            "LEFT JOIN grade AS s02 ON s01.grade_id = s02.id",
            "LEFT JOIN student AS s03 ON s01.student_id = s03.id ",
            "WHERE",
            "s01.year_part = ${yearPart} ",
            "AND s01.quarter_num = ${quarterNum} ",
            "AND s01.is_last = 1 ",
            "AND s01.deleted = 0 ",
            "AND s01.`status` =1 ",
            "and s02.year_class_id in(${item.yearClassIdStr})",
            "and s02.subjects_id in(${item.subjectsIdStr})",
            "AND s01.`reading_status` in (1,5,6) ",
            "AND s01.lesson_type = 1 ",
            "<when test='studentName!=null and studentName!=&apos;&apos; '>",
            "AND s03.`name` like '%${studentName}%'",
            "</when>",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",
            "GROUP BY",
            "student_id,",
            "subjects_id ",
            ") AS t01",
            "<if test='include == 0'>",
            "INNER JOIN (select * from record_course where year_part = ${yearPart} AND `quarter`= ${quarterNum} and lesson_type = 1 and course_type in (1,4) and lesson_num = 1 and deleted = 0 GROUP BY student_id,subjects_id) as t04 on t01.student_id = t04.student_id and t01.subjects_id = t04.subjects_id",
            "</if>",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND exam_num = ${examNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t02 ON t01.student_id = t02.student_id ",
            "AND t01.subjects_id = t02.subjects_id",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${item.upYearPart} AND quarter_num = ${item.upQuarterNum} AND exam_num = ${item.upExamNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t03 ON t01.student_id = t03.student_id ",
            "AND t01.subjects_id = t03.subjects_id ",
            "</foreach>",
            "LEFT JOIN transcript_exclude AS t05 ON t05.student_id = t01.student_id AND t05.subjects_id = t01.subjects_id AND t05.year_part = t01.year_part AND t05.quarter_num = t01.quarter_num AND t05.exam_num = t02.exam_num",
            "WHERE t05.id IS NULL ",
            ") AS t2 ON t2.teacher_id = t1.teacher_id ",
            "AND ( find_in_set( t2.year_class_id, t1.year_class_id_str ) OR t1.year_class_id_str = '' ) ",
            "AND ( find_in_set( t2.school_id, t1.school_id_str ) OR t1.school_id_str = '' ) ",
            ") AS t",
            "${ew.customSqlSegment}",
            "</script>"})
    public IPage<ScoreDataDetail> carrySoreDataTeamDetail(IPage<?> page, @Param("yearPart") Integer yearPart, @Param("quarterNum") Integer quarterNum, @Param("examNum") Integer examNum, @Param("include") Integer include, @Param("studentName") String studentName,@Param("courseTypeId") String courseTypeId, @Param(Constants.WRAPPER) Wrapper wrapper, @Param("tsSet11") TranscriptSafetyScoreSet tsSet11,@Param("tsSet12") TranscriptSafetyScoreSet tsSet12,@Param("tsSet21") TranscriptSafetyScoreSet tsSet21,@Param("tsSet22") TranscriptSafetyScoreSet tsSet22,@Param("tsSet32") TranscriptSafetyScoreSet tsSet32, @Param("tsSetList") List<TranscriptSafetyDiffSet> tsSetList, @Param("classify") String classify, @Param("trackType") String trackType, @Param("teamId") String teamId);

    /**
     * 优秀与不优秀
     *
     * @param page
     * @param yearPart
     * @param quarterNum
     * @param examNum
     * @param wrapper
     * @return
     */
    @Select({"<script>",
            "SELECT",
            "* ",
            "FROM",
            "(",
            "SELECT",
            "*,",
            "getStaffNameForId ( teacher_id ) AS teacher_name,",
            "getSchoolName ( school_id ) AS school_name,",
            "getDictName ( year_class_id, 14 ) AS year_class_name,",

            "CASE",
            "",
            "WHEN score_end &lt; ${tsSet11.passScore} ",
            "AND grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND ((",
            "is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            ") ",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )) THEN",
            "1 ",
            "WHEN ((score_end &lt; ${tsSet12.passScore} and subjects_id &lt;&gt; 3) or (score_end &lt; ${tsSet32.passScore} and subjects_id =3))",
            "AND grade_section = 2 ",
            "AND ((",
            "is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            ") ",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )",
            ") THEN",
            "1 ELSE 0 ",
            "END AS no_pass_count,",

            "CASE",
            "",
            "WHEN score_end &gt;= ${tsSet11.passScore} ",
            "AND grade_section = 1 ",
            "AND (",
            "is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )) THEN",
            "1 ",
            "WHEN ((score_end &gt;= ${tsSet12.passScore} and subjects_id &lt;&gt; 3) or (score_end &gt;= ${tsSet32.passScore} and subjects_id =3))",
            "AND grade_section = 2 ",
            "AND (",
            "is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )",
            "OR ( subjects_id =3 and year_class_id = 8 AND quarter_num = 4 AND is_statistics = 1 )",
            ") THEN",
            "1 ELSE 0 ",
            "END AS pass_count, ",

            "CASE",
            "",
            "WHEN grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "AND score_end &lt; ${tsSet11.passScore} ",
            "</when>",
            "THEN",
            "score_end - score_start_b ",
            "WHEN grade_section = 2 ",
            "AND ((subjects_id &lt;&gt;3",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet12.passScore} ",
            "</when>",
            ") or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id &lt;&gt; 8) OR (subjects_id = 3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1 )",
            " or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id &lt;&gt; 8) OR (subjects_id = 3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id = 8 AND quarter_num &lt;&gt; 4 )",
            ") THEN",
            "score_end - score_start_b ELSE 0",
            "END AS diff_score, ",

            "CASE",
            "",
            "WHEN score_end &gt;= score_start_b ",
            "AND grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "AND score_end &gt;= ${tsSet11.carryScore} THEN 1",
            "WHEN score_end &gt;= score_start_b ",
            "AND grade_section = 2 ",
            "AND ((score_end &gt;= ${tsSet12.carryScore} and subjects_id &lt;&gt;3) or (score_end &gt;= ${tsSet32.carryScore} and subjects_id =3 and year_class_id &lt;&gt; 8) OR ( score_end &gt;= ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1) OR ( score_end &gt;= ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND quarter_num &lt;&gt; 4) ) THEN",
            "1 ELSE 0 ",
            "END AS diff_pass_count ",

            "FROM",
            "(",
            "<foreach collection='tsSetList' item='item' open='' separator='UNION all' close=''>",
            "SELECT",
            "t01.*,",
            "t02.exam_num,",
            "IFNULL( t02.score, 0 ) score,",
            "IFNULL( t02.score_start, 0 ) score_start,",
            "IFNULL( t02.score_end, 0 ) score_end,",
            "IFNULL( t02.is_statistics, 0 ) is_statistics,",
            "IFNULL( t03.score, 0 ) score_b,",
            "IFNULL( t03.score_start, 0 ) score_start_b,",
            "IFNULL( t03.score_end, 0 ) score_end_b,",
            "IFNULL( t03.is_statistics, 0 ) is_statistics_b ",
            "FROM",
            "(",
            "SELECT",
            "s01.subjects_id,",
            "s01.student_id,",
            "s01.year_part,",
            "s01.quarter_num,",
            "s01.year_class_id,",
            "s01.grade_id,",
            "getGradeSectionForYearClassId ( s01.year_class_id ) AS grade_section,",
            "s03.`name` AS student_name, ",

            "<when test='dataType!=null and dataType!=&apos;&apos; and dataType != 4 '>",
            "s01.school_id,",
            "s02.teacher_id ",
            "</when>",

            "<when test='dataType!=null and dataType!=&apos;&apos; and dataType == 4 '>",
            // 成绩数据4，跟缴费率一样，大于等于8次课，调出老师在职算调出老师，调出老师离职算原带班所属校区校长
            "s02.teacher_id tack_teacher_id,",
            "( CASE WHEN s04.in_school_id IS NOT NULL THEN s04.in_school_id ELSE s01.school_id END ) AS school_id,",
            "( CASE WHEN s04.schoolmaster_id IS NOT NULL THEN s04.schoolmaster_id ELSE s02.teacher_id END ) AS teacher_id ",
            "</when>",

            "FROM",
            "student_grade AS s01",
            "LEFT JOIN grade AS s02 ON s01.grade_id = s02.id",
            "LEFT JOIN student AS s03 ON s01.student_id = s03.id ",
            "<when test='dataType!=null and dataType!=&apos;&apos; and dataType == 4 '>",
            "LEFT JOIN leave_teacher_student AS s04 ON s01.year_part = s04.year_part ",
            "AND s01.quarter_num = s04.quarter_num ",
            "AND s01.subjects_id = s04.subjects_id ",
            "AND s01.student_id = s04.student_id ",
            "</when>",
            "WHERE",
            "s01.year_part = ${yearPart} ",
            "AND s01.quarter_num = ${quarterNum} ",
            "AND s01.is_last = 1 ",
            "AND s01.deleted = 0 ",
            "AND s01.`status` =1 ",
            "and s02.year_class_id in(${item.yearClassIdStr})",
            "and s02.subjects_id in(${item.subjectsIdStr})",
            "AND s01.`reading_status` in (1,5,6) ",
            "AND s01.lesson_type = 1 ",
            "<when test='studentName!=null and studentName!=&apos;&apos; '>",
            "AND s03.`name` like '%${studentName}%'",
            "</when>",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",
            "GROUP BY",
            "student_id,",
            "subjects_id ",
            ") AS t01",
            "<if test='include == 0'>",
            "INNER JOIN (select * from record_course where year_part = ${yearPart} AND `quarter`= ${quarterNum} and lesson_type = 1 and course_type in (1,4) and lesson_num = 1 and deleted = 0 GROUP BY student_id,subjects_id) as t04 on t01.student_id = t04.student_id and t01.subjects_id = t04.subjects_id",
            "</if>",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND exam_num = ${examNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t02 ON t01.student_id = t02.student_id ",
            "AND t01.subjects_id = t02.subjects_id",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${item.upYearPart} AND quarter_num = ${item.upQuarterNum} AND exam_num = ${item.upExamNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t03 ON t01.student_id = t03.student_id ",
            "AND t01.subjects_id = t03.subjects_id ",
            "LEFT JOIN transcript_exclude AS t05 ON t05.student_id = t01.student_id AND t05.subjects_id = t01.subjects_id AND t05.year_part = t01.year_part AND t05.quarter_num = t01.quarter_num AND t05.exam_num = t02.exam_num",
            "WHERE t05.id IS NULL ",
            "</foreach>",
            ") AS t1 ",
            ") AS t",
            "${ew.customSqlSegment}",
            "</script>"})
    public IPage<ScoreDataDetail> excellentSoreDataDetail(IPage<?> page, @Param("yearPart") Integer yearPart, @Param("quarterNum") Integer quarterNum, @Param("examNum") Integer examNum, @Param("include") Integer include, @Param("studentName") String studentName, @Param("courseTypeId") String courseTypeId, @Param(Constants.WRAPPER) Wrapper wrapper, @Param("tsSet11") TranscriptSafetyScoreSet tsSet11, @Param("tsSet12") TranscriptSafetyScoreSet tsSet12, @Param("tsSet21") TranscriptSafetyScoreSet tsSet21, @Param("tsSet22") TranscriptSafetyScoreSet tsSet22, @Param("tsSet32") TranscriptSafetyScoreSet tsSet32, @Param("tsSetList") List<TranscriptSafetyDiffSet> tsSetList, @Param("dataType") String dataType);

    @Select({"<script>",
            "SELECT",
            "* ",
            "FROM",
            "(",
            "SELECT",
            "t2.*,",
            "getStaffNameForId ( t2.teacher_id ) AS teacher_name,",
            "getSchoolName ( school_id ) AS school_name,",
            "getDictName ( year_class_id, 14 ) AS year_class_name,",

            "CASE",
            "",
            "WHEN score_end &lt; ${tsSet11.passScore} ",
            "AND grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND ((",
            "is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            ") ",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )) THEN",
            "1 ",
            "WHEN ((score_end &lt; ${tsSet12.passScore} and subjects_id &lt;&gt; 3) or (score_end &lt; ${tsSet32.passScore} and subjects_id =3))",
            "AND grade_section = 2 ",
            "AND ((",
            "is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            ") ",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )",
            ") THEN",
            "1 ELSE 0 ",
            "END AS no_pass_count,",

            "CASE",
            "",
            "WHEN score_end &gt;= ${tsSet11.passScore} ",
            "AND grade_section = 1 ",
            "AND (",
            "is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )) THEN",
            "1 ",
            "WHEN ((score_end &gt;= ${tsSet12.passScore} and subjects_id &lt;&gt; 3) or (score_end &gt;= ${tsSet32.passScore} and subjects_id =3))",
            "AND grade_section = 2 ",
            "AND (",
            "is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "OR ( year_class_id = 3 AND quarter_num = 4 AND is_statistics = 1 )",
            "OR ( subjects_id =3 and year_class_id = 8 AND quarter_num = 4 AND is_statistics = 1 )",
            ") THEN",
            "1 ELSE 0 ",
            "END AS pass_count, ",

            "CASE",
            "",
            "WHEN grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "AND score_end &lt; ${tsSet11.passScore} ",
            "</when>",
            "THEN",
            "score_end - score_start_b ",
            "WHEN grade_section = 2 ",
            "AND ((subjects_id &lt;&gt;3",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet12.passScore} ",
            "</when>",
            ") or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id &lt;&gt; 8) OR (subjects_id = 3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1 )",
            " or (subjects_id =3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id &lt;&gt; 8) OR (subjects_id = 3 ",
            "<when test='tsSet12.retrogressType != 1'>",
            "and score_end &lt; ${tsSet32.passScore}",
            "</when>",
            " and year_class_id = 8 AND quarter_num &lt;&gt; 4 )",
            ") THEN",
            "score_end - score_start_b ELSE 0",
            "END AS diff_score, ",

            "CASE",
            "",
            "WHEN score_end &gt;= score_start_b ",
            "AND grade_section = 1 ",
            "and subjects_id &lt;&gt;3",
            "AND is_statistics = 1 ",
            "AND is_statistics_b = 1 ",
            "AND score_end &gt;= ${tsSet11.carryScore} THEN 1",
            "WHEN score_end &gt;= score_start_b ",
            "AND grade_section = 2 ",
            "AND ((score_end &gt;= ${tsSet12.carryScore} and subjects_id &lt;&gt;3) or (score_end &gt;= ${tsSet32.carryScore} and subjects_id =3 and year_class_id &lt;&gt; 8) OR ( score_end &gt;= ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND quarter_num = 4 AND exam_num &lt;&gt; 1) OR ( score_end &gt;= ${tsSet32.carryScore} AND subjects_id = 3 and year_class_id = 8 AND quarter_num &lt;&gt; 4) ) THEN",
            "1 ELSE 0 ",
            "END AS diff_pass_count ",

            "FROM (",
            "SELECT ",
            "td.*,td.sourse_id as teacher_id ,tm.team_name,tm.id AS team_id,tm.pid AS team_pid ",
            "FROM ",
            "track_market AS tm ",
            "LEFT JOIN track_detail AS td ON tm.id = td.track_id ",
            "AND tm.deleted = td.deleted ",
            "WHERE ",
            "tm.classify = ${classify} ",
            "AND tm.track_type = ${trackType} ",
            "AND tm.`status` = 1 ",
            "AND tm.deleted = 0 ",
            "AND tm.year_part = ${yearPart} ",
            "AND tm.quarter_num = ${quarterNum} ",
            "<when test='teamId!=null and teamId!=&apos;&apos; '>",
            "and tm.id IN (${teamId}) ",
            "</when>",
            "GROUP BY ",
            "tm.id,td.sourse_id ",
            ") AS t1 ",
            "LEFT JOIN (",
            "<foreach collection='tsSetList' item='item' open='' separator='UNION all' close=''>",
            "SELECT",
            "t01.*,",
            "t02.exam_num,",
            "IFNULL( t02.score, 0 ) score,",
            "IFNULL( t02.score_start, 0 ) score_start,",
            "IFNULL( t02.score_end, 0 ) score_end,",
            "IFNULL( t02.is_statistics, 0 ) is_statistics,",
            "IFNULL( t03.score, 0 ) score_b,",
            "IFNULL( t03.score_start, 0 ) score_start_b,",
            "IFNULL( t03.score_end, 0 ) score_end_b,",
            "IFNULL( t03.is_statistics, 0 ) is_statistics_b ",
            "FROM",
            "(",
            "SELECT",
            "s01.subjects_id,",
            "s01.student_id,",
            "s01.year_part,",
            "s01.quarter_num,",
            "s01.year_class_id,",
            "s01.grade_id,",
            "getGradeSectionForYearClassId ( s01.year_class_id ) AS grade_section,",
            "s03.`name` AS student_name, ",

            "<when test='dataType!=null and dataType!=&apos;&apos; and dataType != 4 '>",
            "s01.school_id,",
            "s02.teacher_id ",
            "</when>",

            "<when test='dataType!=null and dataType!=&apos;&apos; and dataType == 4 '>",
            // 成绩数据4，跟缴费率一样，大于等于8次课，调出老师在职算调出老师，调出老师离职算原带班所属校区校长
            "s02.teacher_id tack_teacher_id,",
            "( CASE WHEN s04.in_school_id IS NOT NULL THEN s04.in_school_id ELSE s01.school_id END ) AS school_id,",
            "( CASE WHEN s04.schoolmaster_id IS NOT NULL THEN s04.schoolmaster_id ELSE s02.teacher_id END ) AS teacher_id ",
            "</when>",

            "FROM",
            "student_grade AS s01",
            "LEFT JOIN grade AS s02 ON s01.grade_id = s02.id",
            "LEFT JOIN student AS s03 ON s01.student_id = s03.id ",
            "<when test='dataType!=null and dataType!=&apos;&apos; and dataType == 4 '>",
            "LEFT JOIN leave_teacher_student AS s04 ON s01.year_part = s04.year_part ",
            "AND s01.quarter_num = s04.quarter_num ",
            "AND s01.subjects_id = s04.subjects_id ",
            "AND s01.student_id = s04.student_id ",
            "</when>",
            "WHERE",
            "s01.year_part = ${yearPart} ",
            "AND s01.quarter_num = ${quarterNum} ",
            "AND s01.is_last = 1 ",
            "AND s01.deleted = 0 ",
            "AND s01.`status` =1 ",
            "and s02.year_class_id in(${item.yearClassIdStr})",
            "and s02.subjects_id in(${item.subjectsIdStr})",
            "AND s01.`reading_status` in (1,5,6) ",
            "AND s01.lesson_type = 1 ",
            "<when test='studentName!=null and studentName!=&apos;&apos; '>",
            "AND s03.`name` like '%${studentName}%'",
            "</when>",
            "<when test='courseTypeId!=null and courseTypeId!=&apos;&apos; '>",
            "AND s02.`course_type_id` in(${courseTypeId}) ",
            "</when>",
            "GROUP BY",
            "student_id,",
            "subjects_id ",
            ") AS t01",
            "<if test='include == 0'>",
            "INNER JOIN (select * from record_course where year_part = ${yearPart} AND `quarter`= ${quarterNum} and lesson_type = 1 and course_type in (1,4) and lesson_num = 1 and deleted = 0 GROUP BY student_id,subjects_id) as t04 on t01.student_id = t04.student_id and t01.subjects_id = t04.subjects_id",
            "</if>",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${yearPart} AND quarter_num = ${quarterNum} AND exam_num = ${examNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t02 ON t01.student_id = t02.student_id ",
            "AND t01.subjects_id = t02.subjects_id",
            "LEFT JOIN ( SELECT * FROM transcript WHERE year_part = ${item.upYearPart} AND quarter_num = ${item.upQuarterNum} AND exam_num = ${item.upExamNum} AND deleted = 0 GROUP BY student_id,subjects_id) AS t03 ON t01.student_id = t03.student_id ",
            "AND t01.subjects_id = t03.subjects_id ",
            "LEFT JOIN transcript_exclude AS t05 ON t05.student_id = t01.student_id AND t05.subjects_id = t01.subjects_id AND t05.year_part = t01.year_part AND t05.quarter_num = t01.quarter_num AND t05.exam_num = t02.exam_num",
            "WHERE t05.id IS NULL ",
            "</foreach>",
            ") AS t2 ON t2.teacher_id = t1.teacher_id ",
            "AND ( find_in_set( t2.year_class_id, t1.year_class_id_str ) OR t1.year_class_id_str = '' ) ",
            "AND ( find_in_set( t2.school_id, t1.school_id_str ) OR t1.school_id_str = '' ) ",
            ") AS t",
            "${ew.customSqlSegment}",
            "</script>"})
    public IPage<ScoreDataDetail> excellentSoreDataTeamDetail(IPage<?> page, @Param("yearPart") Integer yearPart, @Param("quarterNum") Integer quarterNum, @Param("examNum") Integer examNum, @Param("include") Integer include, @Param("studentName") String studentName, @Param("courseTypeId") String courseTypeId, @Param(Constants.WRAPPER) Wrapper wrapper, @Param("tsSet11") TranscriptSafetyScoreSet tsSet11, @Param("tsSet12") TranscriptSafetyScoreSet tsSet12, @Param("tsSet21") TranscriptSafetyScoreSet tsSet21, @Param("tsSet22") TranscriptSafetyScoreSet tsSet22, @Param("tsSet32") TranscriptSafetyScoreSet tsSet32, @Param("tsSetList") List<TranscriptSafetyDiffSet> tsSetList, @Param("dataType") String dataType, @Param("classify") String classify, @Param("trackType") String trackType, @Param("teamId") String teamId);

}
